home *** CD-ROM | disk | FTP | other *** search
- diff -u /usr/src/mpeg_encode-1.3/src/main.c mpeg/main.c
- --- /usr/src/mpeg_encode-1.3/src/main.c Tue Mar 15 01:26:51 1994
- +++ mpeg/main.c Fri Jul 1 12:47:34 1994
- @@ -91,6 +91,8 @@
- boolean computeMVHist = FALSE;
- int baseFormat;
-
- +int wait_and_destroy= 0; /* set by flag, for qt2mpeg */
- +
- /*===============================*
- * INTERNAL PROCEDURE prototypes *
- *===============================*/
- @@ -161,6 +163,9 @@
- } else {
- Usage();
- }
- + } else if ( strcmp(argv[index], "-wait") == 0 ) {
- + wait_and_destroy= 1;
- + index++;
- } else if ( strcmp(argv[index], "-frames") == 0 ) {
- if ( (function != ENCODE_FRAMES) || (whichGOP != -1) ) {
- Usage();
- diff -u /usr/src/mpeg_encode-1.3/src/readframe.c mpeg/readframe.c
- --- /usr/src/mpeg_encode-1.3/src/readframe.c Tue Mar 15 01:26:55 1994
- +++ mpeg/readframe.c Fri Jul 1 12:55:24 1994
- @@ -68,7 +68,10 @@
- #define PPM_READ_STATE_MAXVAL 3
- #define PPM_READ_STATE_DONE 4
-
- +#define WAITING if (wait_and_destroy)
-
- +extern int wait_and_destroy;
- +
- /*==================*
- * STATIC VARIABLES *
- *==================*/
- @@ -175,11 +178,21 @@
- exit(1);
- }
- } else {
- - if ( (ifp = fopen(fullFileName, "r")) == NULL ) {
- - fprintf(stderr, "ERROR: Couldn't open input file %s\n",
- - fullFileName);
- - exit(1);
- - }
- +WAITING fprintf(stderr,"mpeg: waiting for input: %s\n",fullFileName);
- +WAITING while (1) {
- + if ( (ifp = fopen(fullFileName, "r")) == NULL ) {
- +WAITING fclose(ifp);
- +WAITING continue;
- + fprintf(stderr, "ERROR: Couldn't open input file %s\n",
- + fullFileName);
- + exit(1);
- + }
- +/* fseek(ifp,0,2);
- + * if (ftell(ifp)< 120*160*3) { fclose(ifp); continue; }
- + * fseek(ifp,0,0);
- + */ break;
- + }
- +WAITING fprintf(stderr,"mpeg: got %s\n",fullFileName);
- }
-
- switch(baseFormat) {
- @@ -212,6 +225,8 @@
- } else {
- fclose(ifp);
- }
- +WAITING remove(fullFileName);
- +WAITING fprintf(stderr,"mpeg: removed: %s\n",fullFileName);
-
- #ifdef BLEAH
- time(&diskEndTime);
-
-